package demo27;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sr=new Scanner(System.in);
        String b=sr.next();
        char a =b.charAt(0);
        if (b.length()==1) {
            if ((a>='a'&&a<='z')||(a>='A'&&a<='Z')) {
                if(a >= 'a' && a <= 'c' || a <= 'C'){
                    System.out.println(2);
                }else if(a >= 'd' && a <= 'f' || a <= 'F'){
                    System.out.println(3);
                }else if(a >= 'g' && a <= 'i' || a <= 'I'){
                    System.out.println(4);
                }else if(a >= 'j' && a <= 'l' || a <= 'L'){
                    System.out.println(5);
                }else if(a >= 'm' && a <= 'o' || a <= 'O'){
                    System.out.println(6);
                }else if(a >= 'p' && a <= 's' || a <= 'S'){
                    System.out.println(7);
                }else if(a >= 't' && a <= 'v' || a <= 'V'){
                    System.out.println(8);
                }else if(a >= 'w' && a <= 'z' || a <= 'Z'){
                    System.out.println(9);
                }
            }else {
                System.out.println(b+" is an invalid input");
            }
        }else {
            System.out.println(1);
        }
    }
}
